//
//  ContactListener.h
//  StarBugs
//
//  Created by ?? ? on 12/27/11.
//  Copyright 2011 antisword@playorca.com. All rights reserved.
//

#ifndef __CONTRACTLISTENER_H__
#define __CONTRACTLISTENER_H__

#include "cocos2d.h"
#include "Box2D.h"

struct MyContact{
    b2Fixture *fixtureA;
    b2Fixture *fixtureB;
    
    bool operator == (const MyContact& other) const
    {
        return (fixtureA == other.fixtureA) && (fixtureB == other.fixtureB);
    }
};

class ContactListener : public b2ContactListener
{
public:
    std::vector<MyContact>_contacts;
    ContactListener();
    void BeginContact(b2Contact* contact);
    void EndContact(b2Contact* contact);
    void PreSolve(b2Contact* contact, const b2Manifold* oldManifold);
    void PostSolve(b2Contact* contact, const b2ContactImpulse* impulse);
    
    
};
#endif//__CONTRACTLISTENER_H__